<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
$(function(){
	$("#folderName").textbox({
		required: true
	});
	$("#folderNum").numberbox({
		required: true,
	    min:0,
	    precision:0
	});
	$("#parentName").textbox({
		editable:false
	});
	$("#saveButton").click(function(){
		if($("#folderForm").form('validate')){
			$("#saveButton").linkbutton('disable');
			$.ajax({
				   type: "POST",
				   url: "<c:url value='/docFolder/docFolderSave' />",
				   data: $.trim($('#folderForm').serialize()),
				   async: false,
				   success: function(msg){
				     if(msg.state=="200"){
				    	 treeSelectedId=msg.id;
				    	 $("#folderTree").tree("reload");
				    	 $("#folderDialog").dialog('close');
				     }else{
				    	 $.messager.alert('提示','数据保存失败');
				     }
				   }
				});
			$("#saveButton").linkbutton('enable');
		}
	});
	$("#backButton").click(function(){
		$("#folderDialog").dialog("close");
	});
});